﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;

namespace CustomTypes.Mono.Extensions
{

    public static class MemberReferenceHelper
    {

        //public static bool CanWrite(this MemberReference member)
        //{
        //    bool retour = false;
        //    switch (member.MemberType)
        //    {

        //        case System.Reflection.MemberTypes.Field:
        //            retour = true;
        //            break;
        //        case System.Reflection.MemberTypes.Property:
        //            retour = (member as PropertyReference).Resolve().CanWrite;
        //            break;

        //        case System.Reflection.MemberTypes.All:
        //        case System.Reflection.MemberTypes.Constructor:
        //        case System.Reflection.MemberTypes.Custom:
        //        case System.Reflection.MemberTypes.Event:
        //        case System.Reflection.MemberTypes.Method:
        //        case System.Reflection.MemberTypes.NestedType:
        //        case System.Reflection.MemberTypes.TypeInfo:
        //        default:
        //            break;
        //    }

        //    return retour;

        //}

        //public static bool CanRead(this MemberReference member)
        //{
        //    bool retour = false;
        //    switch (member.MemberType)
        //    {

        //        case System.Reflection.MemberTypes.Field:
        //            retour = true;
        //            break;
        //        case System.Reflection.MemberTypes.Property:
        //            retour = (member as PropertyReference).Resolve().GetMethod != null;
        //            break;

        //        case System.Reflection.MemberTypes.Method:
        //            retour = (member as MethodReference).Resolve().ReturnType.Name != "Void";
        //            break;

        //        case System.Reflection.MemberTypes.All:
        //        case System.Reflection.MemberTypes.Constructor:
        //        case System.Reflection.MemberTypes.Custom:
        //        case System.Reflection.MemberTypes.Event:                
        //        case System.Reflection.MemberTypes.NestedType:
        //        case System.Reflection.MemberTypes.TypeInfo:
        //        default:
        //            break;
        //    }

        //    return retour;

        //}

    }
}
